//
//  EquipmentInFHeader.h
//  xpkc
//
//  Created by wanmeizty on 14-8-18.
//  Copyright (c) 2014年 wanmeizty. All rights reserved.
//


#define   IsIOS7  ([[UIDevice currentDevice] systemVersion].floatValue >= 7.0)
#define   IsIOS8  ([[UIDevice currentDevice] systemVersion].floatValue >= 8.0)
#define   IS_CH_SYMBOL(chr) ((int)(chr)>127)
#if DEBUG
#define logtrace() NSLog(@"%s():%d ", __func__, __LINE__)
#define logdebug(format, ...) NSLog(@"%s():%d " format, __func__, __LINE__, ##__VA_ARGS__)
#else
#define logdebug(format, ...)
#define logtrace()
#endif

#define Window_Height [[UIScreen mainScreen] bounds].size.height
#define Window_Width [[UIScreen mainScreen] bounds].size.width

//定义屏幕的宽度
#define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width<[UIScreen mainScreen].bounds.size.height?[UIScreen mainScreen].bounds.size.width:[UIScreen mainScreen].bounds.size.height)
//定义屏幕的高度
#define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.width>[UIScreen mainScreen].bounds.size.height?[UIScreen mainScreen].bounds.size.width:[UIScreen mainScreen].bounds.size.height)
//判断是否是Pad
#define isPad (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
//字体
#define FONT_SYS_BIG [UIFont systemFontOfSize:21]
#define FONT_SYS_NORMAL [UIFont systemFontOfSize:16]
#define FONT_SYS_LITTLE [UIFont systemFontOfSize:14]
#define FONT_SYS_XL [UIFont systemFontOfSize:20]
#define FONT_SYS_L [UIFont systemFontOfSize:18]
#define FONT_SYS_M [UIFont systemFontOfSize:16]
#define FONT_SYS_S [UIFont systemFontOfSize:14]
#define FONT_SYS_XS [UIFont systemFontOfSize:12]
#define FONT_SYS_XXS [UIFont systemFontOfSize:10]
#define FONT_SYS_XXXS [UIFont systemFontOfSize:8]
#define FONT_SYS(x) [UIFont systemFontOfSize:x]
#define FONT_BOLD(x) [UIFont boldSystemFontOfSize:x]
#define FONT_BOLD_BIG [UIFont boldSystemFontOfSize:21]
//路径
#define DOC_PATH [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]
//#define CACH_PATH [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0]
#define DOWNLOADED_PLIST @"downloaded.plist"
#define DOWNLOADING_PLIST @"downloading.plist"
#define PLAYEDTIME_PLIST @"playedtime.plist"
#define CATAGOLUE_PLIST @"catagolue.plist"
#define DOWNLOADED_PATH [NSString stringWithFormat:@"%@/%@",DOC_PATH,DOWNLOADED_PLIST]
#define DOWNLOADING_PATH [NSString stringWithFormat:@"%@/%@",DOC_PATH,DOWNLOADING_PLIST]
#define PLAYEDTIME_PATH [NSString stringWithFormat:@"%@/%@",DOC_PATH,PLAYEDTIME_PLIST]
#define CATAGOLUE_PATH [NSString stringWithFormat:@"%@/%@",DOC_PATH,CATAGOLUE_PLIST]
//主页栏目
#define HOME_IN_COLUMN_PLIST @"homeincolumn.plist"
#define HOME_OUT_COLUMN_PLIST @"homeoutcolumn.plist"
#define HOME_IN_PATH [NSString stringWithFormat:@"%@/%@",DOC_PATH,HOME_IN_COLUMN_PLIST]
#define HOME_OUT_PATH [NSString stringWithFormat:@"%@/%@",DOC_PATH,HOME_OUT_COLUMN_PLIST]
//存储资讯栏目顺序Commonly
#define COMMONLYCOLUMN_PLIST @"commonlycolumn.plist"
#define COMMONLYCOLUMN_PATH [NSString stringWithFormat:@"%@/%@",DOC_PATH,COMMONLYCOLUMN_PLIST]
#define OTHERCOLUMN_PLIST @"othercolumn.plist"
#define OTHERCOLUMN_PATH [NSString stringWithFormat:@"%@/%@",DOC_PATH,OTHERCOLUMN_PLIST]
//收藏视频
#define FAVORITE_PLIST @"favorite.plist"
#define FAVORITE_PATH [NSString stringWithFormat:@"%@/%@",DOC_PATH,FAVORITE_PLIST]
//bug
#define BUGLOG_TXT @"buglog.txt"
#define BUGLOG_PATH [NSString stringWithFormat:@"%@/%@",DOC_PATH,BUGLOG_TXT]
// 账户信息
#define USER_FREE                           @"FREE"
#define USER_DRM                            @"DRM"
#define DWACCOUNT_USERID                    @"B21C8E6C9A6E7CD1"
#define DWACCOUNT_APIKEY                    @"b2BGKJj8ZHHslFRtrwQHpySnPyaHRxg6"

#define DWACCOUNT_USERID_FREE               @"F1135F980802D08E"
#define DWACCOUNT_APIKEY_FREE               @"8uqG5E1iHg1opwYJNXCa4RIDhZ7WHhTe"
//开始下载的通知
#define START_DOWNLOAD_NOTIFICATION         @"START_DOWNLOAD_NOTIFICATION"
//清空后刷新的通知
#define CLEAR_DATA_REFRESH_TABLEVIEW        @"CLEAR_DATA_REFRESH_TABLEVIEW"
//退出后保存的通知
#define SAVE_DATA_WHEN_EXIT                 @"SAVE_DATA_WHEN_EXIT"


#define RECT(x,y,w,h) CGRectMake(x, y, w, h)

//颜色
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
#define RGBCOLOR(r,g,b) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:1]
#define CCOLOR [UIColor clearColor]
//#define GreenColor [UIColor colorWithRed:30.0/255.0 green:200.0/255.0 blue:0.0 alpha:1]
#define GreenColor [UIColor colorWithRed:0.0/255.0 green:180.0/255.0 blue:127.0/255.0 alpha:1]
#define LightGreenColor [UIColor colorWithRed:140.0/255.0 green:255.0/255.0 blue:225.0/255.0 alpha:1]
#define OrangeColor [UIColor colorWithRed:255.0/255.0 green:159.0/255.0 blue:33.0/255.0 alpha:1]
#define WhiteSmokeColor [UIColor colorWithRed:245.0/255.0 green:245.0/255.0 blue:245.0/255.0 alpha:1]
#define BGColor RGBCOLOR(240,240,245)

#define FONT(x) [UIFont systemFontOfSize:x]
#define FONT_SYSTEM(x) [UIFont systemFontOfSize:x]

#define ShowAlertMsg(msg) [[[UIAlertView alloc] initWithTitle:@"温馨提示" message:msg delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil]show]
//软件更新
//#define UpdateURL [NSString stringWithFormat:@"%@updateApplication.action",HTTPM]
//#define APP_URL @"http://itunes.apple.com/cn/lookup?id=897012923"
/**
 *  userName password
 */
#define USERNAME_REMBER @"remember_username"
#define PASSWORD_REMBER @"remember_password"
#define USERMID_REMBER  @"remember_usermid"
#define USERHEAD_REMBER @"remember_userheadicon"
#define USER_REMBER     @"remember_user"
#define WIFI_ONLY       @"WIFI"
#define REMEMBER_LAST   @"remember"
#define REMIND_STUDY    @"remind"
#define NUM_MSG         @"num_msg"
#define NUM_ACT         @"num_actives"
#define NUM_ORDER       @"num_orders"
#define NUM_REQUEST     @"num_request"
#define NUM_NOTE        @"num_note"

//课程中心暂存的上次打开的课程
#define LASTLESSON      @"last_lesson"

static NSString *URL = @"http://192.168.1.102";
static NSString *URL2= @"http://www.studypay.com";
static NSString *KEY = @"0b6f2f666ddfd0e56e4d566f12a0f353";

typedef enum{
    LoginStatueSucc,
    LoginStatueUsernameError,
    LoginStatuePasswordError,
    LoginStatueInternetError
}LoginStatue;
